package com.lxk.ums.controller.app;


import com.lxk.ums.domain.vo.UmsUserVo;
import com.lxk.ums.service.IUmsUserService;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.satoken.utils.LoginHelper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * app用户信息
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/ums/user")
public class AppUserController {

    private final IUmsUserService userService;

    /**
     * 获取用户信息
     *
     * @return
     */
    @GetMapping("/getInfo")
    public R<UmsUserVo> getInfo() {
        Long userId = LoginHelper.getUserId();
        UmsUserVo umsUserVo = userService.queryById(userId);
        return R.ok(umsUserVo);
    }

}
